package com.sinodata.bsm.center.util.web;

public final class MenuUtils {
    /**
     * 
     * @param linkId 链接的ID
     * @param target 链接的框架ID
     * @param linkName 链接名称
     * @param href  URL地址
     * @param actived 当前是否为激活状态
     * @param icon 显示图标
     * @param type 是资源类型还是资源
     * @return
     */
    public static String genernateSubMenu(String linkId, String target, String linkName, String href, boolean actived, String icon, int type) {
        StringBuffer bf = new StringBuffer("<a");
        bf.append(" id='" + linkId + "'");
        bf.append(" name='" + linkId + "_" + type + "'");
        bf.append(" target='" + target + "'");
        bf.append(" href='" + href + "'");
        if (actived) {
            bf.append(" class='actived'");
        }
        bf.append(">");
        if (icon != null) {
            bf.append("<img src='../style/default/bsm/png/" + icon + "'/>");
        }
        bf.append(linkName);
        bf.append("</a>");
        return bf.toString();
    }

}
